// prettier-ignore
function Env(t, s) {
    return new class {
        constructor(t, s) {
            this.name = t, this.data = null, this.dataFile = "box.dat", this.logs = [], this.logSeparator = "\n", this.startTime = (new Date).getTime(), Object.assign(this, s), this.log("", `🔔${this.name}, 开始!`)
        }
        isNode() {
            return "undefined" != typeof module && !!module.exports
        }
        isQuanX() {
            return "undefined" != typeof $task
        }
        isSurge() {
            return "undefined" != typeof $httpClient && "undefined" == typeof $loon
        }
        isLoon() {
            return "undefined" != typeof $loon
        }
        getScript(t) {
            return new Promise(s => {
                $.get({
                    url: t
                }, (t, e, i) => s(i))
            })
        }
        runScript(t, s) {
            return new Promise(e => {
                let i = this.getdata("@chavy_boxjs_userCfgs.httpapi");
                i = i ? i.replace(/\n/g, "").trim() : i;
                let o = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");
                o = o ? 1 * o : 20, o = s && s.timeout ? s.timeout : o;
                const [h, a] = i.split("@"), r = {
                    url: `http://${a}/v1/scripting/evaluate`,
                    body: {
                        script_text: t,
                        mock_type: "cron",
                        timeout: o
                    },
                    headers: {
                        "X-Key": h,
                        Accept: "*/*"
                    }
                };
                $.post(r, (t, s, i) => e(i))
            }).catch(t => this.logErr(t))
        }
        loaddata() {
            if (!this.isNode()) return {}; {
                this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path");
                const t = this.path.resolve(this.dataFile),
                    s = this.path.resolve(process.cwd(), this.dataFile),
                    e = this.fs.existsSync(t),
                    i = !e && this.fs.existsSync(s);
                if (!e && !i) return {}; {
                    const i = e ? t : s;
                    try {
                        return JSON.parse(this.fs.readFileSync(i))
                    } catch (t) {
                        return {}
                    }
                }
            }
        }
        writedata() {
            if (this.isNode()) {
                this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path");
                const t = this.path.resolve(this.dataFile),
                    s = this.path.resolve(process.cwd(), this.dataFile),
                    e = this.fs.existsSync(t),
                    i = !e && this.fs.existsSync(s),
                    o = JSON.stringify(this.data);
                e ? this.fs.writeFileSync(t, o) : i ? this.fs.writeFileSync(s, o) : this.fs.writeFileSync(t, o)
            }
        }
        lodash_get(t, s, e) {
            const i = s.replace(/\[(\d+)\]/g, ".$1").split(".");
            let o = t;
            for (const t of i)
                if (o = Object(o)[t], void 0 === o) return e;
            return o
        }
        lodash_set(t, s, e) {
            return Object(t) !== t ? t : (Array.isArray(s) || (s = s.toString().match(/[^.[\]]+/g) || []), s.slice(0, -1).reduce((t, e, i) => Object(t[e]) === t[e] ? t[e] : t[e] = Math.abs(s[i + 1]) >> 0 == +s[i + 1] ? [] : {}, t)[s[s.length - 1]] = e, t)
        }
        getdata(t) {
            let s = this.getval(t);
            if (/^@/.test(t)) {
                const [, e, i] = /^@(.*?)\.(.*?)$/.exec(t), o = e ? this.getval(e) : "";
                if (o) try {
                    const t = JSON.parse(o);
                    s = t ? this.lodash_get(t, i, "") : s
                } catch (t) {
                    s = ""
                }
            }
            return s
        }
        setdata(t, s) {
            let e = !1;
            if (/^@/.test(s)) {
                const [, i, o] = /^@(.*?)\.(.*?)$/.exec(s), h = this.getval(i), a = i ? "null" === h ? null : h || "{}" : "{}";
                try {
                    const s = JSON.parse(a);
                    this.lodash_set(s, o, t), e = this.setval(JSON.stringify(s), i)
                } catch (s) {
                    const h = {};
                    this.lodash_set(h, o, t), e = this.setval(JSON.stringify(h), i)
                }
            } else e = $.setval(t, s);
            return e
        }
        getval(t) {
            return this.isSurge() || this.isLoon() ? $persistentStore.read(t) : this.isQuanX() ? $prefs.valueForKey(t) : this.isNode() ? (this.data = this.loaddata(), this.data[t]) : this.data && this.data[t] || null
        }
        setval(t, s) {
            return this.isSurge() || this.isLoon() ? $persistentStore.write(t, s) : this.isQuanX() ? $prefs.setValueForKey(t, s) : this.isNode() ? (this.data = this.loaddata(), this.data[s] = t, this.writedata(), !0) : this.data && this.data[s] || null
        }
        initGotEnv(t) {
            this.got = this.got ? this.got : require("got"), this.cktough = this.cktough ? this.cktough : require("tough-cookie"), this.ckjar = this.ckjar ? this.ckjar : new this.cktough.CookieJar, t && (t.headers = t.headers ? t.headers : {}, void 0 === t.headers.Cookie && void 0 === t.cookieJar && (t.cookieJar = this.ckjar))
        }
        get(t, s = (() => {})) {
            t.headers && (delete t.headers["Content-Type"], delete t.headers["Content-Length"]), this.isSurge() || this.isLoon() ? $httpClient.get(t, (t, e, i) => {
                !t && e && (e.body = i, e.statusCode = e.status), s(t, e, i)
            }) : this.isQuanX() ? $task.fetch(t).then(t => {
                const {
                    statusCode: e,
                    statusCode: i,
                    headers: o,
                    body: h
                } = t;
                s(null, {
                    status: e,
                    statusCode: i,
                    headers: o,
                    body: h
                }, h)
            }, t => s(t)) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, s) => {
                try {
                    const e = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();
                    this.ckjar.setCookieSync(e, null), s.cookieJar = this.ckjar
                } catch (t) {
                    this.logErr(t)
                }
            }).then(t => {
                const {
                    statusCode: e,
                    statusCode: i,
                    headers: o,
                    body: h
                } = t;
                s(null, {
                    status: e,
                    statusCode: i,
                    headers: o,
                    body: h
                }, h)
            }, t => s(t)))
        }
        post(t, s = (() => {})) {
            if (t.body && t.headers && !t.headers["Content-Type"] && (t.headers["Content-Type"] = "application/x-www-form-urlencoded"), delete t.headers["Content-Length"], this.isSurge() || this.isLoon()) $httpClient.post(t, (t, e, i) => {
                !t && e && (e.body = i, e.statusCode = e.status), s(t, e, i)
            });
            else if (this.isQuanX()) t.method = "POST", $task.fetch(t).then(t => {
                const {
                    statusCode: e,
                    statusCode: i,
                    headers: o,
                    body: h
                } = t;
                s(null, {
                    status: e,
                    statusCode: i,
                    headers: o,
                    body: h
                }, h)
            }, t => s(t));
            else if (this.isNode()) {
                this.initGotEnv(t);
                const {
                    url: e,
                    ...i
                } = t;
                this.got.post(e, i).then(t => {
                    const {
                        statusCode: e,
                        statusCode: i,
                        headers: o,
                        body: h
                    } = t;
                    s(null, {
                        status: e,
                        statusCode: i,
                        headers: o,
                        body: h
                    }, h)
                }, t => s(t))
            }
        }
        time(t) {
            let s = {
                "M+": (new Date).getMonth() + 1,
                "d+": (new Date).getDate(),
                "H+": (new Date).getHours(),
                "m+": (new Date).getMinutes(),
                "s+": (new Date).getSeconds(),
                "q+": Math.floor(((new Date).getMonth() + 3) / 3),
                S: (new Date).getMilliseconds()
            };
            /(y+)/.test(t) && (t = t.replace(RegExp.$1, ((new Date).getFullYear() + "").substr(4 - RegExp.$1.length)));
            for (let e in s) new RegExp("(" + e + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? s[e] : ("00" + s[e]).substr(("" + s[e]).length)));
            return t
        }
        msg(s = t, e = "", i = "", o) {
            const h = t => !t || !this.isLoon() && this.isSurge() ? t : "string" == typeof t ? this.isLoon() ? t : this.isQuanX() ? {
                "open-url": t
            } : void 0 : "object" == typeof t && (t["open-url"] || t["media-url"]) ? this.isLoon() ? t["open-url"] : this.isQuanX() ? t : void 0 : void 0;
            $.isMute || (this.isSurge() || this.isLoon() ? $notification.post(s, e, i, h(o)) : this.isQuanX() && $notify(s, e, i, h(o))), this.logs.push("", "==============📣系统通知📣=============="), this.logs.push(s), e && this.logs.push(e), i && this.logs.push(i)
        }
        log(...t) {
            t.length > 0 ? this.logs = [...this.logs, ...t] : console.log(this.logs.join(this.logSeparator))
        }
        logErr(t, s) {
            const e = !this.isSurge() && !this.isQuanX() && !this.isLoon();
            e ? $.log("", `❗️${this.name}, 错误!`, t.stack) : $.log("", `❗️${this.name}, 错误!`, t)
        }
        wait(t) {
            return new Promise(s => setTimeout(s, t))
        }
        done(t = {}) {
            const s = (new Date).getTime(),
                e = (s - this.startTime) / 1e3;
            this.log("", `🔔${this.name}, 结束! 🕛 ${e} 秒`), this.log(), (this.isSurge() || this.isQuanX() || this.isLoon()) && $done(t)
        }
    }(t, s)
}


var __encode = 'jsjiami.com',
    _a = {},
    _0xb483 = ["_decode", "http://www.sojson.com/javascriptobfuscator.html"];
(function(_0xd642x1) {
    _0xd642x1[_0xb483[0]] = _0xb483[1]
})(_a);
var __Oxc0c9e = ["趣智校园用水", "url", "body", "upload/data", "13036328501", "2024-05-26", "17320396870", "2021-06-06", "18745687454", "2020-04-26", "17671116400", "2021-06-04", "18625755002", "2021-07-04", "", "name", " 获取用户账户ID: 成功,账户ID为: ", "log", "has", "get", " 账户ID: ", ",截至日期:", "，剩余使用时间", "天", " 未授权用户，您的账号不具有使用权限，请加Q 3058649832 解锁使用权", "未授权用户", "您的账号不具有使用权限，欢迎加Q 3058649832 解锁使用权", "msg", " 发生错误:错误信息", "match", " 您的有效使用时长仅剩", "天,为不影响继续使用,请联系QQ 3058649832 解锁", "您的有效使用时长仅剩", "如需继续使用：请联系QQ：3058649832 解锁", "getFullYear", "getMonth", "getDate", "0", "-", "abs", "indexOf", " 恭喜,您的数据校验成功", " 解密算法加载成功,开始数据解密", "xfData=80210331131256000000610000025700004C3002000000F200001388000000540000000CC47F0E0A8CB4", "replace", " 解密数据替换成功", "undefined", "删除", "版本号，js会定", "期弹窗，", "还请支持我们的工作", "jsjia", "mi.com"];
const $ = new Env(__Oxc0c9e[0x0]);
const url = $request[__Oxc0c9e[0x1]];
var body = $request[__Oxc0c9e[0x2]];
const path1 = __Oxc0c9e[0x3];
let iterable = new Map([
    [__Oxc0c9e[0x4], __Oxc0c9e[0x5]],
    [__Oxc0c9e[0x6], __Oxc0c9e[0x7]],
    [__Oxc0c9e[0x8], __Oxc0c9e[0x9]],
    [__Oxc0c9e[0xa], __Oxc0c9e[0xb]],
    [__Oxc0c9e[0xc], __Oxc0c9e[0xd]]
]);
let telphone = GetCookie();
$[__Oxc0c9e[0x11]](`${__Oxc0c9e[0xe]}${$[__Oxc0c9e[0xf]]}${__Oxc0c9e[0x10]}${telphone}${__Oxc0c9e[0xe]}`);
try {
    if (iterable[__Oxc0c9e[0x12]](telphone)) {
        var today_time = FormatDate();
        var deadline = iterable[__Oxc0c9e[0x13]](telphone);
        var iDays = DateDiff(today_time, deadline);
        $[__Oxc0c9e[0x11]](`${__Oxc0c9e[0xe]}${$[__Oxc0c9e[0xf]]}${__Oxc0c9e[0x14]}${telphone}${__Oxc0c9e[0x15]}${deadline}${__Oxc0c9e[0x16]}${iDays}${__Oxc0c9e[0x17]}`);
        if (today_time <= deadline) {
            reWrite();
            notify()
        }
    } else {
        $[__Oxc0c9e[0x11]](`${__Oxc0c9e[0xe]}${$[__Oxc0c9e[0xf]]}${__Oxc0c9e[0x18]}`);
        $[__Oxc0c9e[0x1b]]($[__Oxc0c9e[0xf]], `${__Oxc0c9e[0x19]}`, `${__Oxc0c9e[0x1a]}`)
    }
} catch (error) {
    $[__Oxc0c9e[0x11]](`${__Oxc0c9e[0xe]}${$[__Oxc0c9e[0xf]]}${__Oxc0c9e[0x1c]}${error}${__Oxc0c9e[0xe]}`)
};

function GetCookie() {
    if ($request && url[__Oxc0c9e[0x1d]](/\/upload\/data/)) {
        const _0xfb45xb = body[__Oxc0c9e[0x1d]](/telPhone=(\d+)/)[0x1];
        return _0xfb45xb
    }
}

function notify() {
    if (iDays < 3) {
        $[__Oxc0c9e[0x11]](`${__Oxc0c9e[0xe]}${$[__Oxc0c9e[0xf]]}${__Oxc0c9e[0x1e]}${iDays}${__Oxc0c9e[0x1f]}`);
        $[__Oxc0c9e[0x1b]]($[__Oxc0c9e[0xf]], `${__Oxc0c9e[0x20]}${iDays}${__Oxc0c9e[0x17]}`, `${__Oxc0c9e[0x21]}`)
    }
}

function FormatDate() {
    var _0xfb45xe = new Date();
    var _0xfb45xf = _0xfb45xe[__Oxc0c9e[0x22]]();
    var _0xfb45x10 = _0xfb45xe[__Oxc0c9e[0x23]]();
    var _0xfb45x11 = _0xfb45xe[__Oxc0c9e[0x24]]();
    _0xfb45x10 = _0xfb45x10 + 1;
    if (_0xfb45x10 < 10) {
        _0xfb45x10 = __Oxc0c9e[0x25] + _0xfb45x10
    };
    if (_0xfb45x11 < 10) {
        _0xfb45x11 = __Oxc0c9e[0x25] + _0xfb45x11
    };
    var _0xfb45x12 = _0xfb45xf + __Oxc0c9e[0x26] + _0xfb45x10 + __Oxc0c9e[0x26] + _0xfb45x11;
    return _0xfb45x12
}

function DateDiff(_0xfb45x14, _0xfb45x15) {
    var _0xfb45x16 = new Date(_0xfb45x14);
    var _0xfb45x17 = new Date(_0xfb45x15);
    var _0xfb45x18 = Math[__Oxc0c9e[0x27]](_0xfb45x17 - _0xfb45x16) / (1000 * 60 * 60 * 24);
    return _0xfb45x18
}

function reWrite() {
    if (url[__Oxc0c9e[0x28]](path1) != -1) {
        if (body[__Oxc0c9e[0x28]](telphone) != -1) {
            $[__Oxc0c9e[0x11]](`${__Oxc0c9e[0xe]}${$[__Oxc0c9e[0xf]]}${__Oxc0c9e[0x29]}`);
            $[__Oxc0c9e[0x11]](`${__Oxc0c9e[0xe]}${$[__Oxc0c9e[0xf]]}${__Oxc0c9e[0x2a]}`);
            body = body[__Oxc0c9e[0x2c]](/xfData=(\w+)/, __Oxc0c9e[0x2b]);
            $[__Oxc0c9e[0x11]](`${__Oxc0c9e[0xe]}${$[__Oxc0c9e[0xf]]}${__Oxc0c9e[0x2d]}`);
            $done({
                body
            })
        }
    }
}(function(_0xfb45x1a, _0xfb45x1b, _0xfb45x1c, _0xfb45x1d, _0xfb45x1e, _0xfb45x1f) {
    _0xfb45x1f = __Oxc0c9e[0x2e];
    _0xfb45x1d = function(_0xfb45x20) {
        if (typeof alert !== _0xfb45x1f) {
            alert(_0xfb45x20)
        };
        if (typeof console !== _0xfb45x1f) {
            console[__Oxc0c9e[0x11]](_0xfb45x20)
        }
    };
    _0xfb45x1c = function(_0xfb45x21, _0xfb45x1a) {
        return _0xfb45x21 + _0xfb45x1a
    };
    _0xfb45x1e = _0xfb45x1c(__Oxc0c9e[0x2f], _0xfb45x1c(_0xfb45x1c(__Oxc0c9e[0x30], __Oxc0c9e[0x31]), __Oxc0c9e[0x32]));
    try {
        _0xfb45x1a = __encode;
        if (!(typeof _0xfb45x1a !== _0xfb45x1f && _0xfb45x1a === _0xfb45x1c(__Oxc0c9e[0x33], __Oxc0c9e[0x34]))) {
            _0xfb45x1d(_0xfb45x1e)
        }
    } catch (e) {
        _0xfb45x1d(_0xfb45x1e)
    }
})({})